
#include "../myTime.hpp"
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;

struct st {
  std::vector<double> vec;
  int t;
  double s;
  struct inner {
    int a{10};
  };
};

int main() {
  const int n = 100000;

  st v;
  v.vec.resize(n);

  MyTimer(0, "struct1");
  for (int i = 0; i < n; ++i)
    v.vec[i] = i * 2;
  MyTimer(1, "struct1");

  MyTimer(0, "ref");
  vector<double> &rv = v.vec;
  for (int i = 0; i < n; ++i)
    rv[i] = i * 3;
  MyTimer(1, "ref");

  MyTimer(0, "struct2");
  for (int i = 0; i < n; ++i)
    v.vec[i] = i * 4;
  MyTimer(1, "struct2");

  st::inner in;
  cout << in.a << endl;

  return 0;
}